home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / CIncludes / CTBUtilities.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-29  |  3.1 KB  |  142 lines  |  [TEXT/MPS ]

  1.  
  2. /************************************************************
  3.  
  4. Created: Tuesday, September 10, 1991 at 10:29 AM
  5.  CTBUtilities.h
  6.  C Interface to the Macintosh Libraries
  7.  
  8.  
  9.   Copyright Apple Computer, Inc. 1988-1991
  10.   All rights reserved
  11.  
  12. ************************************************************/
  13.  
  14.  
  15. #ifndef __CTBUTILITIES__
  16. #define __CTBUTILITIES__
  17.  
  18. #ifndef __MEMORY__
  19. #include <Memory.h>
  20. #endif
  21.  
  22. #ifndef __PACKAGES__
  23. #include <Packages.h>
  24. #endif
  25.  
  26. #ifndef __APPLETALK__
  27. #include <AppleTalk.h>
  28. #endif
  29.  
  30.  
  31. enum {
  32.  
  33.  
  34. /* version of Comm Toolbox Utilities */
  35.  curCTBUVersion = 2,
  36.  
  37. /*    Error codes/types    */
  38.  ctbuGenericError = -1,
  39.  ctbuNoErr = 0
  40. };
  41.  
  42. typedef OSErr CTBUErr;
  43.  
  44. enum {chooseDisaster = -2,chooseFailed,chooseAborted,chooseOKMinor,chooseOKMajor,
  45.  chooseCancel};
  46. typedef unsigned short ChooseReturnCode;
  47.  
  48. enum {nlOk,nlCancel,nlEject};
  49. typedef unsigned short NuLookupReturnCode;
  50.  
  51. enum {nameInclude = 1,nameDisable,nameReject};
  52. typedef unsigned short NameFilterReturnCode;
  53.  
  54. enum {zoneInclude = 1,zoneDisable,zoneReject};
  55. typedef unsigned short ZoneFilterReturnCode;
  56.  
  57.  
  58. enum {
  59.  
  60.  
  61. /*    Values for hookProc items        */
  62.  hookOK = 1,
  63.  hookCancel = 2,
  64.  hookOutline = 3,
  65.  hookTitle = 4,
  66.  hookItemList = 5,
  67.  hookZoneTitle = 6,
  68.  hookZoneList = 7,
  69.  hookLine = 8,
  70.  hookVersion = 9,
  71.  hookReserved1 = 10,
  72.  hookReserved2 = 11,
  73.  hookReserved3 = 12,
  74.  hookReserved4 = 13,
  75.  
  76. /*    "virtual" hookProc items    */
  77.  hookNull = 100,
  78.  hookItemRefresh = 101,
  79.  hookZoneRefresh = 102,
  80.  hookEject = 103,
  81.  hookPreflight = 104,
  82.  hookPostflight = 105,
  83.  hookKeyBase = 1000
  84. };
  85.  
  86.  
  87. /*    NuLookup structures/constants    */
  88. struct NLTypeEntry {
  89.  Handle hIcon;
  90.  Str32 typeStr;
  91. };
  92.  
  93. typedef struct NLTypeEntry NLTypeEntry;
  94.  
  95.  
  96. typedef NLTypeEntry NLType[4];
  97.  
  98. struct NBPReply {
  99.  EntityName theEntity;
  100.  AddrBlock theAddr;
  101. };
  102.  
  103. typedef struct NBPReply NBPReply;
  104.  
  105.  
  106. typedef pascal short (*NameFilterProcPtr)(EntityName theEntity);
  107. typedef pascal short (*ZoneFilterProcPtr)(Str32 theZone);
  108.  
  109. typedef NameFilterProcPtr nameFilterProcPtr;
  110. typedef ZoneFilterProcPtr zoneFilterProcPtr;
  111.  
  112. #ifdef __cplusplus
  113. extern "C" {
  114. #endif
  115. pascal CTBUErr InitCTBUtilities(void); 
  116. pascal short CTBGetCTBVersion(void); 
  117.  
  118.  
  119. pascal short StandardNBP(Point where,ConstStr255Param prompt,short numTypes,
  120.  NLType typeList,NameFilterProcPtr nameFilter,ZoneFilterProcPtr zoneFilter,
  121.  DlgHookProcPtr hookProc,NBPReply *theReply); 
  122.  
  123. pascal short CustomNBP(Point where,ConstStr255Param prompt,short numTypes,
  124.  NLType typeList,NameFilterProcPtr nameFilter,ZoneFilterProcPtr zoneFilter,
  125.  DlgHookProcPtr hookProc,long userData,short dialogID,ModalFilterProcPtr filterProc,
  126.  NBPReply *theReply); 
  127.  
  128. /*  Obsolete synonyms for above routines  */
  129. pascal short NuLookup(Point where,ConstStr255Param prompt,short numTypes,
  130.  NLType typeList,NameFilterProcPtr nameFilter,ZoneFilterProcPtr zoneFilter,
  131.  DlgHookProcPtr hookProc,NBPReply *theReply); 
  132.  
  133. pascal short NuPLookup(Point where,ConstStr255Param prompt,short numTypes,
  134.  NLType typeList,NameFilterProcPtr nameFilter,ZoneFilterProcPtr zoneFilter,
  135.  DlgHookProcPtr hookProc,long userData,short dialogID,ModalFilterProcPtr filterProc,
  136.  NBPReply *theReply); 
  137. #ifdef __cplusplus
  138. }
  139. #endif
  140.  
  141. #endif
  142.